package com.hackerrank.contests.cspakistan.challenges.ninemensmorris;

import java.util.Scanner;

public class Solution {
	private static final String INIT = "INIT", MILL = "MILL", MOVE = "MOVE";
	
	private static void init(char p, String m, String[] b) {
		for(int r = 0; r < 3; r++) {
			int i = 3 - r;
			for(int c = r; c < 7; c += i) {
				
			}
		}
		for(int c = 0; c < 3; c++) {
			
		}
		for(int c = 4; c < 7; c++) {
			
		}
		for(int r = 4; r < 7; r++) {
			int i = r - 3;
			for(int c = 6 - r; c < 7; c += i) {
				
			}
		}
	}
	
	// Head ends here
	private static void nextMove(String player, String m, String [] b) {
		char p = player.charAt(0);
		if(m.equalsIgnoreCase(INIT))
			init(p, b);
		else if(m.equalsIgnoreCase(MILL))
			mill(p, b);
		else if(m.equalsIgnoreCase(MOVE))
			move(p, b);
	}
	
	// Tail starts here
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String player, move;
		String board[] = new String[7];

		player = in.next();
		move = in.next();
		for(int i = 0; i < 7; i++)
			board[i] = in.next();

		nextMove(player, move, board);
	}
}
